package com.esri.core.symbol.advanced;

import com.esri.core.geometry.Point;
import java.util.List;
import java.util.Map;

/* loaded from: classes.dex */
public class MessageHelper {
    public static final String MESSAGE_2525C_CONTROL_POINTS_PROPERTY_NAME = "_Control_Points";
    public static final String MESSAGE_ACTION_PROPERTY_NAME = "_Action";
    public static final String MESSAGE_ACTION_VALUE_HIGHLIGHT = "select";
    public static final String MESSAGE_ACTION_VALUE_REMOVE = "remove";
    public static final String MESSAGE_ACTION_VALUE_UNHIGHLIGHT = "un-select";
    public static final String MESSAGE_ACTION_VALUE_UPDATE = "update";
    public static final String MESSAGE_ID_PROPERTY_NAME = "_ID";
    public static final String MESSAGE_TYPE_PROPERTY_NAME = "_Type";
    public static final String MESSAGE_WKID_PROPERTY_NAME = "_WKID";
    public static final String MESSAGE_WKT_PROPERTY_NAME = "_WKT";

    private static Message a(String str, String str2) {
        Message message = new Message();
        message.setID(str);
        if (str2 != null) {
            message.setProperty(MESSAGE_TYPE_PROPERTY_NAME, str2);
        }
        return message;
    }

    public static Message create2525CHighlightMessage(String str, String str2, boolean z) {
        Message a = a(str, str2);
        if (z) {
            a.setProperty(MESSAGE_ACTION_PROPERTY_NAME, MESSAGE_ACTION_VALUE_HIGHLIGHT);
        } else {
            a.setProperty(MESSAGE_ACTION_PROPERTY_NAME, MESSAGE_ACTION_VALUE_UNHIGHLIGHT);
        }
        return a;
    }

    public static Message create2525CRemoveMessage(String str, String str2) {
        Message a = a(str, str2);
        a.setProperty(MESSAGE_ACTION_PROPERTY_NAME, MESSAGE_ACTION_VALUE_REMOVE);
        return a;
    }

    public static Message create2525CUpdateMessage(String str, String str2, List<Point> list, Map<String, Object> map) {
        Message a = a(str, str2);
        a.setProperty(MESSAGE_ACTION_PROPERTY_NAME, MESSAGE_ACTION_VALUE_UPDATE);
        StringBuilder sb = new StringBuilder();
        int i = 0;
        for (Point point : list) {
            sb.append(point.getX());
            sb.append(",");
            sb.append(point.getY());
            if (i < list.size() - 1) {
                sb.append(";");
            }
            i++;
        }
        a.setProperty(MESSAGE_2525C_CONTROL_POINTS_PROPERTY_NAME, sb.toString());
        a.addProperties(map);
        return a;
    }

    public static Message create2525CUpdateMessage(String str, String str2, Object obj) {
        Message a = a(str, null);
        a.setProperty(str2, obj);
        return a;
    }

    public static Message create2525CUpdateMessage(String str, Map<String, Object> map) {
        Message a = a(str, null);
        a.addProperties(map);
        return a;
    }

    public static Message create2525CUpdateMessage(String str, String str2, List<Point> list, Map<String, Object> map, int i) {
        Message create2525CUpdateMessage = create2525CUpdateMessage(str, str2, list, map);
        create2525CUpdateMessage.setProperty(MESSAGE_WKID_PROPERTY_NAME, new Integer(i));
        return create2525CUpdateMessage;
    }

    public static Message create2525CUpdateMessage(String str, String str2, List<Point> list, Map<String, Object> map, String str3) {
        Message create2525CUpdateMessage = create2525CUpdateMessage(str, str2, list, map);
        create2525CUpdateMessage.setProperty(MESSAGE_WKID_PROPERTY_NAME, str3);
        return create2525CUpdateMessage;
    }
}
